package com.atguigu.gmall.all.service;

import org.springframework.web.context.ServletContextAware;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.servlet.support.RequestContextUtils;

import javax.servlet.ServletContext;

public class IndexServiceImpl implements ServletContextAware {



    private ServletContext servletContext;
    @Override
    public void setServletContext(ServletContext servletContext) {

        ServletRequestAttributes requestAttributes =
                (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
        this.servletContext = servletContext;
    }
}
